home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / xulrunner-1.9.1.5 / xulrunner < prev    next >
Text File  |  2009-11-09  |  4KB  |  142 lines

  1. #!/bin/sh
  2. #
  3. # ***** BEGIN LICENSE BLOCK *****
  4. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. #
  6. # The contents of this file are subject to the Mozilla Public License Version
  7. # 1.1 (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. # http://www.mozilla.org/MPL/
  10. #
  11. # Software distributed under the License is distributed on an "AS IS" basis,
  12. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. # for the specific language governing rights and limitations under the
  14. # License.
  15. #
  16. # The Original Code is mozilla.org code.
  17. #
  18. # The Initial Developer of the Original Code is
  19. # Netscape Communications Corporation.
  20. # Portions created by the Initial Developer are Copyright (C) 1998
  21. # the Initial Developer. All Rights Reserved.
  22. #
  23. # Contributor(s):
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either the GNU General Public License Version 2 or later (the "GPL"), or
  27. # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. # in which case the provisions of the GPL or the LGPL are applicable instead
  29. # of those above. If you wish to allow use of your version of this file only
  30. # under the terms of either the GPL or the LGPL, and not to allow others to
  31. # use your version of this file under the terms of the MPL, indicate your
  32. # decision by deleting the provisions above and replace them with the notice
  33. # and other provisions required by the GPL or the LGPL. If you do not delete
  34. # the provisions above, a recipient may use your version of this file under
  35. # the terms of any one of the MPL, the GPL or the LGPL.
  36. #
  37. # ***** END LICENSE BLOCK *****
  38.  
  39. ## 
  40. ## Usage:
  41. ##
  42. ## $ mozilla [args]
  43. ##
  44. ## This script is meant to run the application binary from mozilla/dist/bin.
  45. ##
  46. ## The script will setup all the environment voodoo needed to make
  47. ## the application binary to work.
  48. ##
  49.  
  50. #uncomment for debugging
  51. #set -x
  52.  
  53. moz_libdir=/usr/lib/xulrunner-1.9.1.5
  54.  
  55. # Use run-mozilla.sh in the current dir if it exists
  56. # If not, then start resolving symlinks until we find run-mozilla.sh
  57. found=0
  58. progname="$0"
  59. curdir=`dirname "$progname"`
  60. progbase=`basename "$progname"`
  61. run_moz="$curdir/run-mozilla.sh"
  62. if test -x "$run_moz"; then
  63.   dist_bin="$curdir"
  64.   found=1
  65. else
  66.   here=`/bin/pwd`
  67.   while [ -h "$progname" ]; do
  68.     bn=`basename "$progname"`
  69.     cd `dirname "$progname"`
  70.     progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' `
  71.     progbase=`basename "$progname"`
  72.     if [ ! -x "$progname" ]; then
  73.       break
  74.     fi
  75.     curdir=`dirname "$progname"`
  76.     run_moz="$curdir/run-mozilla.sh"
  77.     if [ -x "$run_moz" ]; then
  78.       cd "$curdir"
  79.       dist_bin=`pwd`
  80.       run_moz="$dist_bin/run-mozilla.sh"
  81.       found=1
  82.       break
  83.     fi
  84.   done
  85.   cd "$here"
  86. fi
  87. if [ $found = 0 ]; then
  88.   # Check default compile-time libdir
  89.   if [ -x "$moz_libdir/run-mozilla.sh" ]; then
  90.     dist_bin="$moz_libdir"
  91.     run_moz="$moz_libdir/run-mozilla.sh"
  92.   else
  93.     echo "Cannot find XULRunner runtime directory. Exiting."
  94.     exit 1
  95.   fi
  96. fi
  97.  
  98. script_args=""
  99. debugging=0
  100. MOZILLA_BIN="${progbase}-bin"
  101.  
  102. if [ "$OSTYPE" = "beos" ]; then
  103.   mimeset -F "$MOZILLA_BIN"
  104. fi
  105.  
  106. pass_arg_count=0
  107. while [ $# -gt $pass_arg_count ]
  108. do
  109.   case "$1" in
  110.     -p | --pure | -pure)
  111.       MOZILLA_BIN="${MOZILLA_BIN}.pure"
  112.       shift
  113.       ;;
  114.     -g | --debug)
  115.       script_args="$script_args -g"
  116.       debugging=1
  117.       shift
  118.       ;;
  119.     -d | --debugger)
  120.       script_args="$script_args -d $2"
  121.       shift 2
  122.       ;;
  123.     *)
  124.       # Move the unrecognized argument to the end of the list.
  125.       arg="$1"
  126.       shift
  127.       set -- "$@" "$arg"
  128.       pass_arg_count=`expr $pass_arg_count + 1`
  129.       ;;
  130.   esac
  131. done
  132.  
  133. if [ $debugging = 1 ]
  134. then
  135.   echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
  136. fi
  137. "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
  138. exitcode=$?
  139.  
  140. exit $exitcode
  141. # EOF.
  142.